/***************************************************************************\
 * Copyright (C) by Keio University
 * RigidTransformationEstimation.hpp created in 10 2012.
 * Mail : fdesorbi@hvrl.ics.keio.ac.jp
 *
 * RigidTransformationEstimation.hpp is part of the HVRL Engine Project.
 *
 * The HVRL Engine Project is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * The HVRL Engine Project is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 \***************************************************************************/

#ifndef RIGID_TRANSFORMATION_ESTIMATION_HPP__
#define RIGID_TRANSFORMATION_ESTIMATION_HPP__

#include <opencv2/opencv.hpp>

namespace hvrl {

namespace RigidTransformationEstimation {

/**
 * \brief compute the rigid transformation between two 3D point clouds.
 *
 * The method is described in "Least-squares estimation of transformation parameters between two point patterns" by Shinji Umeyama
 *
 * \param srcA the first input 3D point cloud
 * \param srcB the second input 3D point cloud
 * \param R will receive the result of the estimation of the rotation and scaling matrices
 * \param t will receive the result of the estimation of the translation matrix
 * \return true it has been successfully estimated, otherwise false
 * \author Francois de Sorbier
 */
bool leastSquaresEstimation(const cv::Mat& srcA, const cv::Mat& srcB,
		cv::Mat& R, cv::Vec3f& t);

}

}

#endif
